package com.example.shkjdemo.lottie

import android.os.Bundle
import android.widget.ScrollView
import androidx.appcompat.app.AppCompatActivity
import com.airbnb.lottie.LottieAnimationView
import com.example.shkjdemo.AlwaysMarqueeTextView
import com.example.shkjdemo.R


class LottieActivity : AppCompatActivity() {
    lateinit var lottieView: LottieAnimationView
    lateinit var tv_scroll: AlwaysMarqueeTextView
    lateinit var mScrollView: ScrollView

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_lottie)
        lottieView = findViewById(R.id.lottieAnimationView)
        tv_scroll = findViewById(R.id.tv_scroll)
        mScrollView = findViewById(R.id.mScrollView)
        lottieView.playAnimation()
    }

    override fun onStop() {
        super.onStop()
//        暂停播放
        lottieView.pauseAnimation()
    }

    override fun onDestroy() {
        super.onDestroy()
//        取消播放
        lottieView.cancelAnimation()
    }
}
